package com.tpcpp.ssh.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.tpcpp.ssh.dao.IUserDao;
import com.tpcpp.ssh.pojo.User;
@Repository("userDao")
public class UserDaoImpl implements IUserDao {
	@Autowired
	private SessionFactory sessionFactory;
	
	private Session getCurrentSession(){
		return this.sessionFactory.getCurrentSession();
	}

	@Override
	public User load(Integer id) {
		return (User) this.getCurrentSession().load(User.class, id);  
	}

}
